package nowcoder.hw.hj03;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
        String input =null;
        while ((input=reader.readLine())!=null){
            int cnt =Integer.valueOf(input);
            List<Integer> list=new ArrayList<>(1001);
            for (;cnt>0;cnt--) {
                Integer num = Integer.valueOf(reader.readLine());
//                System.out.println(String.format("cnt:%d,num:%d", cnt, num));
                if (list.size()!=0){
                    boolean flag=false;
                    for (int i = 0; i < list.size(); i++) {
                        if (num < list.get(i)) {
                            list.add(i, num);
                            flag=true;
                            break;
                        } else if (num - list.get(i) == 0) {
                            flag= true;
                            break;
                        }
                    }
                    if (!flag) {
                        list.add(num);
                    }
                }
                else {
                    list.add(num);
                }

            }
//            System.out.println(String.format("cnt:%d,size:%d", cnt, list.size()));
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < list.size(); i++) {
                sb.append(list.get(i)).append("\n");
            }
            System.out.print(sb.toString());
        }
    }
}